package com.xiashitech.interfaces.grpc;

import static io.grpc.MethodDescriptor.generateFullMethodName;

/**
 */
@javax.annotation.Generated(
    value = "by gRPC proto compiler (version 1.58.0)",
    comments = "Source: agent.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class RPCAuthFactServiceGrpc {

  private RPCAuthFactServiceGrpc() {}

  public static final java.lang.String SERVICE_NAME = "com.xiashitech.interfaces.grpc.RPCAuthFactService";

  // Static method descriptors that strictly reflect the proto.
  private static volatile io.grpc.MethodDescriptor<com.xiashitech.interfaces.grpc.RPCAuthFactRequest,
      com.xiashitech.interfaces.grpc.RPCAuthFactResponse> getBiStreamAuthFactMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "biStreamAuthFact",
      requestType = com.xiashitech.interfaces.grpc.RPCAuthFactRequest.class,
      responseType = com.xiashitech.interfaces.grpc.RPCAuthFactResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
  public static io.grpc.MethodDescriptor<com.xiashitech.interfaces.grpc.RPCAuthFactRequest,
      com.xiashitech.interfaces.grpc.RPCAuthFactResponse> getBiStreamAuthFactMethod() {
    io.grpc.MethodDescriptor<com.xiashitech.interfaces.grpc.RPCAuthFactRequest, com.xiashitech.interfaces.grpc.RPCAuthFactResponse> getBiStreamAuthFactMethod;
    if ((getBiStreamAuthFactMethod = RPCAuthFactServiceGrpc.getBiStreamAuthFactMethod) == null) {
      synchronized (RPCAuthFactServiceGrpc.class) {
        if ((getBiStreamAuthFactMethod = RPCAuthFactServiceGrpc.getBiStreamAuthFactMethod) == null) {
          RPCAuthFactServiceGrpc.getBiStreamAuthFactMethod = getBiStreamAuthFactMethod =
              io.grpc.MethodDescriptor.<com.xiashitech.interfaces.grpc.RPCAuthFactRequest, com.xiashitech.interfaces.grpc.RPCAuthFactResponse>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "biStreamAuthFact"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.xiashitech.interfaces.grpc.RPCAuthFactRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.xiashitech.interfaces.grpc.RPCAuthFactResponse.getDefaultInstance()))
              .setSchemaDescriptor(new RPCAuthFactServiceMethodDescriptorSupplier("biStreamAuthFact"))
              .build();
        }
      }
    }
    return getBiStreamAuthFactMethod;
  }

  /**
   * Creates a new async stub that supports all call types for the service
   */
  public static RPCAuthFactServiceStub newStub(io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<RPCAuthFactServiceStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<RPCAuthFactServiceStub>() {
        @java.lang.Override
        public RPCAuthFactServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new RPCAuthFactServiceStub(channel, callOptions);
        }
      };
    return RPCAuthFactServiceStub.newStub(factory, channel);
  }

  /**
   * Creates a new blocking-style stub that supports unary and streaming output calls on the service
   */
  public static RPCAuthFactServiceBlockingStub newBlockingStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<RPCAuthFactServiceBlockingStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<RPCAuthFactServiceBlockingStub>() {
        @java.lang.Override
        public RPCAuthFactServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new RPCAuthFactServiceBlockingStub(channel, callOptions);
        }
      };
    return RPCAuthFactServiceBlockingStub.newStub(factory, channel);
  }

  /**
   * Creates a new ListenableFuture-style stub that supports unary calls on the service
   */
  public static RPCAuthFactServiceFutureStub newFutureStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<RPCAuthFactServiceFutureStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<RPCAuthFactServiceFutureStub>() {
        @java.lang.Override
        public RPCAuthFactServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new RPCAuthFactServiceFutureStub(channel, callOptions);
        }
      };
    return RPCAuthFactServiceFutureStub.newStub(factory, channel);
  }

  /**
   */
  public interface AsyncService {

    /**
     * <pre>
     * 服务端推送授权信息
     * </pre>
     */
    default io.grpc.stub.StreamObserver<com.xiashitech.interfaces.grpc.RPCAuthFactRequest> biStreamAuthFact(
        io.grpc.stub.StreamObserver<com.xiashitech.interfaces.grpc.RPCAuthFactResponse> responseObserver) {
      return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getBiStreamAuthFactMethod(), responseObserver);
    }
  }

  /**
   * Base class for the server implementation of the service RPCAuthFactService.
   */
  public static abstract class RPCAuthFactServiceImplBase
      implements io.grpc.BindableService, AsyncService {

    @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
      return RPCAuthFactServiceGrpc.bindService(this);
    }
  }

  /**
   * A stub to allow clients to do asynchronous rpc calls to service RPCAuthFactService.
   */
  public static final class RPCAuthFactServiceStub
      extends io.grpc.stub.AbstractAsyncStub<RPCAuthFactServiceStub> {
    private RPCAuthFactServiceStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected RPCAuthFactServiceStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new RPCAuthFactServiceStub(channel, callOptions);
    }

    /**
     * <pre>
     * 服务端推送授权信息
     * </pre>
     */
    public io.grpc.stub.StreamObserver<com.xiashitech.interfaces.grpc.RPCAuthFactRequest> biStreamAuthFact(
        io.grpc.stub.StreamObserver<com.xiashitech.interfaces.grpc.RPCAuthFactResponse> responseObserver) {
      return io.grpc.stub.ClientCalls.asyncBidiStreamingCall(
          getChannel().newCall(getBiStreamAuthFactMethod(), getCallOptions()), responseObserver);
    }
  }

  /**
   * A stub to allow clients to do synchronous rpc calls to service RPCAuthFactService.
   */
  public static final class RPCAuthFactServiceBlockingStub
      extends io.grpc.stub.AbstractBlockingStub<RPCAuthFactServiceBlockingStub> {
    private RPCAuthFactServiceBlockingStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected RPCAuthFactServiceBlockingStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new RPCAuthFactServiceBlockingStub(channel, callOptions);
    }
  }

  /**
   * A stub to allow clients to do ListenableFuture-style rpc calls to service RPCAuthFactService.
   */
  public static final class RPCAuthFactServiceFutureStub
      extends io.grpc.stub.AbstractFutureStub<RPCAuthFactServiceFutureStub> {
    private RPCAuthFactServiceFutureStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected RPCAuthFactServiceFutureStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new RPCAuthFactServiceFutureStub(channel, callOptions);
    }
  }

  private static final int METHODID_BI_STREAM_AUTH_FACT = 0;

  private static final class MethodHandlers<Req, Resp> implements
      io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
    private final AsyncService serviceImpl;
    private final int methodId;

    MethodHandlers(AsyncService serviceImpl, int methodId) {
      this.serviceImpl = serviceImpl;
      this.methodId = methodId;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        default:
          throw new AssertionError();
      }
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public io.grpc.stub.StreamObserver<Req> invoke(
        io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        case METHODID_BI_STREAM_AUTH_FACT:
          return (io.grpc.stub.StreamObserver<Req>) serviceImpl.biStreamAuthFact(
              (io.grpc.stub.StreamObserver<com.xiashitech.interfaces.grpc.RPCAuthFactResponse>) responseObserver);
        default:
          throw new AssertionError();
      }
    }
  }

  public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) {
    return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
        .addMethod(
          getBiStreamAuthFactMethod(),
          io.grpc.stub.ServerCalls.asyncBidiStreamingCall(
            new MethodHandlers<
              com.xiashitech.interfaces.grpc.RPCAuthFactRequest,
              com.xiashitech.interfaces.grpc.RPCAuthFactResponse>(
                service, METHODID_BI_STREAM_AUTH_FACT)))
        .build();
  }

  private static abstract class RPCAuthFactServiceBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
    RPCAuthFactServiceBaseDescriptorSupplier() {}

    @java.lang.Override
    public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
      return com.xiashitech.interfaces.grpc.RPCAgentServiceApi.getDescriptor();
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
      return getFileDescriptor().findServiceByName("RPCAuthFactService");
    }
  }

  private static final class RPCAuthFactServiceFileDescriptorSupplier
      extends RPCAuthFactServiceBaseDescriptorSupplier {
    RPCAuthFactServiceFileDescriptorSupplier() {}
  }

  private static final class RPCAuthFactServiceMethodDescriptorSupplier
      extends RPCAuthFactServiceBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
    private final java.lang.String methodName;

    RPCAuthFactServiceMethodDescriptorSupplier(java.lang.String methodName) {
      this.methodName = methodName;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
      return getServiceDescriptor().findMethodByName(methodName);
    }
  }

  private static volatile io.grpc.ServiceDescriptor serviceDescriptor;

  public static io.grpc.ServiceDescriptor getServiceDescriptor() {
    io.grpc.ServiceDescriptor result = serviceDescriptor;
    if (result == null) {
      synchronized (RPCAuthFactServiceGrpc.class) {
        result = serviceDescriptor;
        if (result == null) {
          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
              .setSchemaDescriptor(new RPCAuthFactServiceFileDescriptorSupplier())
              .addMethod(getBiStreamAuthFactMethod())
              .build();
        }
      }
    }
    return result;
  }
}
